<?php


abstract class BaseAteneausuario extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $nomb_usuario;


	
	protected $clave;


	
	protected $rol_id;


	
	protected $url_foto;


	
	protected $clave_especial;


	
	protected $userlevel;


	
	protected $fname;


	
	protected $lname;

	
	protected $aRol;

	
	protected $collAsignarEsts;

	
	protected $lastAsignarEstCriteria = null;

	
	protected $collCitasRelatedByEspecialistaId;

	
	protected $lastCitaRelatedByEspecialistaIdCriteria = null;

	
	protected $collCitasRelatedBySolicitanteId;

	
	protected $lastCitaRelatedBySolicitanteIdCriteria = null;

	
	protected $collConsultas;

	
	protected $lastConsultaCriteria = null;

	
	protected $collDatoEstudiantes;

	
	protected $lastDatoEstudianteCriteria = null;

	
	protected $collDatoPersonals;

	
	protected $lastDatoPersonalCriteria = null;

	
	protected $collDatoTrabajos;

	
	protected $lastDatoTrabajoCriteria = null;

	
	protected $collEstudianteAspirantes;

	
	protected $lastEstudianteAspiranteCriteria = null;

	
	protected $collExpedienteEstAsesors;

	
	protected $lastExpedienteEstAsesorCriteria = null;

	
	protected $collHorarios;

	
	protected $lastHorarioCriteria = null;

	
	protected $collMensajeriaInternas;

	
	protected $lastMensajeriaInternaCriteria = null;

	
	protected $collNoticias;

	
	protected $lastNoticiaCriteria = null;

	
	protected $collSesionAsesorias;

	
	protected $lastSesionAsesoriaCriteria = null;

	
	protected $collSolicitudTallers;

	
	protected $lastSolicitudTallerCriteria = null;

	
	protected $collUsuarioDepartamentos;

	
	protected $lastUsuarioDepartamentoCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getNombUsuario()
	{

		return $this->nomb_usuario;
	}

	
	public function getClave()
	{

		return $this->clave;
	}

	
	public function getRolId()
	{

		return $this->rol_id;
	}

	
	public function getUrlFoto()
	{

		return $this->url_foto;
	}

	
	public function getClaveEspecial()
	{

		return $this->clave_especial;
	}

	
	public function getUserlevel()
	{

		return $this->userlevel;
	}

	
	public function getFname()
	{

		return $this->fname;
	}

	
	public function getLname()
	{

		return $this->lname;
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::ID;
		}

	} 
	
	public function setNombUsuario($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->nomb_usuario !== $v) {
			$this->nomb_usuario = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::NOMB_USUARIO;
		}

	} 
	
	public function setClave($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->clave !== $v) {
			$this->clave = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::CLAVE;
		}

	} 
	
	public function setRolId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->rol_id !== $v) {
			$this->rol_id = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::ROL_ID;
		}

		if ($this->aRol !== null && $this->aRol->getId() !== $v) {
			$this->aRol = null;
		}

	} 
	
	public function setUrlFoto($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->url_foto !== $v) {
			$this->url_foto = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::URL_FOTO;
		}

	} 
	
	public function setClaveEspecial($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->clave_especial !== $v) {
			$this->clave_especial = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::CLAVE_ESPECIAL;
		}

	} 
	
	public function setUserlevel($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->userlevel !== $v) {
			$this->userlevel = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::USERLEVEL;
		}

	} 
	
	public function setFname($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->fname !== $v) {
			$this->fname = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::FNAME;
		}

	} 
	
	public function setLname($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->lname !== $v) {
			$this->lname = $v;
			$this->modifiedColumns[] = AteneausuarioPeer::LNAME;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->nomb_usuario = $rs->getString($startcol + 1);

			$this->clave = $rs->getString($startcol + 2);

			$this->rol_id = $rs->getInt($startcol + 3);

			$this->url_foto = $rs->getString($startcol + 4);

			$this->clave_especial = $rs->getString($startcol + 5);

			$this->userlevel = $rs->getInt($startcol + 6);

			$this->fname = $rs->getString($startcol + 7);

			$this->lname = $rs->getString($startcol + 8);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 9; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Ateneausuario object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(AteneausuarioPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			AteneausuarioPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(AteneausuarioPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aRol !== null) {
				if ($this->aRol->isModified()) {
					$affectedRows += $this->aRol->save($con);
				}
				$this->setRol($this->aRol);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = AteneausuarioPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += AteneausuarioPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			if ($this->collAsignarEsts !== null) {
				foreach($this->collAsignarEsts as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCitasRelatedByEspecialistaId !== null) {
				foreach($this->collCitasRelatedByEspecialistaId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collCitasRelatedBySolicitanteId !== null) {
				foreach($this->collCitasRelatedBySolicitanteId as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collConsultas !== null) {
				foreach($this->collConsultas as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collDatoEstudiantes !== null) {
				foreach($this->collDatoEstudiantes as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collDatoPersonals !== null) {
				foreach($this->collDatoPersonals as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collDatoTrabajos !== null) {
				foreach($this->collDatoTrabajos as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEstudianteAspirantes !== null) {
				foreach($this->collEstudianteAspirantes as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collExpedienteEstAsesors !== null) {
				foreach($this->collExpedienteEstAsesors as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHorarios !== null) {
				foreach($this->collHorarios as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collMensajeriaInternas !== null) {
				foreach($this->collMensajeriaInternas as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collNoticias !== null) {
				foreach($this->collNoticias as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collSesionAsesorias !== null) {
				foreach($this->collSesionAsesorias as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collSolicitudTallers !== null) {
				foreach($this->collSolicitudTallers as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUsuarioDepartamentos !== null) {
				foreach($this->collUsuarioDepartamentos as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aRol !== null) {
				if (!$this->aRol->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aRol->getValidationFailures());
				}
			}


			if (($retval = AteneausuarioPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collAsignarEsts !== null) {
					foreach($this->collAsignarEsts as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCitasRelatedByEspecialistaId !== null) {
					foreach($this->collCitasRelatedByEspecialistaId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collCitasRelatedBySolicitanteId !== null) {
					foreach($this->collCitasRelatedBySolicitanteId as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collConsultas !== null) {
					foreach($this->collConsultas as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collDatoEstudiantes !== null) {
					foreach($this->collDatoEstudiantes as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collDatoPersonals !== null) {
					foreach($this->collDatoPersonals as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collDatoTrabajos !== null) {
					foreach($this->collDatoTrabajos as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEstudianteAspirantes !== null) {
					foreach($this->collEstudianteAspirantes as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collExpedienteEstAsesors !== null) {
					foreach($this->collExpedienteEstAsesors as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHorarios !== null) {
					foreach($this->collHorarios as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collMensajeriaInternas !== null) {
					foreach($this->collMensajeriaInternas as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collNoticias !== null) {
					foreach($this->collNoticias as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collSesionAsesorias !== null) {
					foreach($this->collSesionAsesorias as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collSolicitudTallers !== null) {
					foreach($this->collSolicitudTallers as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collUsuarioDepartamentos !== null) {
					foreach($this->collUsuarioDepartamentos as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = AteneausuarioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getNombUsuario();
				break;
			case 2:
				return $this->getClave();
				break;
			case 3:
				return $this->getRolId();
				break;
			case 4:
				return $this->getUrlFoto();
				break;
			case 5:
				return $this->getClaveEspecial();
				break;
			case 6:
				return $this->getUserlevel();
				break;
			case 7:
				return $this->getFname();
				break;
			case 8:
				return $this->getLname();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = AteneausuarioPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getNombUsuario(),
			$keys[2] => $this->getClave(),
			$keys[3] => $this->getRolId(),
			$keys[4] => $this->getUrlFoto(),
			$keys[5] => $this->getClaveEspecial(),
			$keys[6] => $this->getUserlevel(),
			$keys[7] => $this->getFname(),
			$keys[8] => $this->getLname(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = AteneausuarioPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setNombUsuario($value);
				break;
			case 2:
				$this->setClave($value);
				break;
			case 3:
				$this->setRolId($value);
				break;
			case 4:
				$this->setUrlFoto($value);
				break;
			case 5:
				$this->setClaveEspecial($value);
				break;
			case 6:
				$this->setUserlevel($value);
				break;
			case 7:
				$this->setFname($value);
				break;
			case 8:
				$this->setLname($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = AteneausuarioPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setNombUsuario($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setClave($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setRolId($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setUrlFoto($arr[$keys[4]]);
		if (array_key_exists($keys[5], $arr)) $this->setClaveEspecial($arr[$keys[5]]);
		if (array_key_exists($keys[6], $arr)) $this->setUserlevel($arr[$keys[6]]);
		if (array_key_exists($keys[7], $arr)) $this->setFname($arr[$keys[7]]);
		if (array_key_exists($keys[8], $arr)) $this->setLname($arr[$keys[8]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(AteneausuarioPeer::DATABASE_NAME);

		if ($this->isColumnModified(AteneausuarioPeer::ID)) $criteria->add(AteneausuarioPeer::ID, $this->id);
		if ($this->isColumnModified(AteneausuarioPeer::NOMB_USUARIO)) $criteria->add(AteneausuarioPeer::NOMB_USUARIO, $this->nomb_usuario);
		if ($this->isColumnModified(AteneausuarioPeer::CLAVE)) $criteria->add(AteneausuarioPeer::CLAVE, $this->clave);
		if ($this->isColumnModified(AteneausuarioPeer::ROL_ID)) $criteria->add(AteneausuarioPeer::ROL_ID, $this->rol_id);
		if ($this->isColumnModified(AteneausuarioPeer::URL_FOTO)) $criteria->add(AteneausuarioPeer::URL_FOTO, $this->url_foto);
		if ($this->isColumnModified(AteneausuarioPeer::CLAVE_ESPECIAL)) $criteria->add(AteneausuarioPeer::CLAVE_ESPECIAL, $this->clave_especial);
		if ($this->isColumnModified(AteneausuarioPeer::USERLEVEL)) $criteria->add(AteneausuarioPeer::USERLEVEL, $this->userlevel);
		if ($this->isColumnModified(AteneausuarioPeer::FNAME)) $criteria->add(AteneausuarioPeer::FNAME, $this->fname);
		if ($this->isColumnModified(AteneausuarioPeer::LNAME)) $criteria->add(AteneausuarioPeer::LNAME, $this->lname);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(AteneausuarioPeer::DATABASE_NAME);

		$criteria->add(AteneausuarioPeer::ID, $this->id);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		return $this->getId();
	}

	
	public function setPrimaryKey($key)
	{
		$this->setId($key);
	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setNombUsuario($this->nomb_usuario);

		$copyObj->setClave($this->clave);

		$copyObj->setRolId($this->rol_id);

		$copyObj->setUrlFoto($this->url_foto);

		$copyObj->setClaveEspecial($this->clave_especial);

		$copyObj->setUserlevel($this->userlevel);

		$copyObj->setFname($this->fname);

		$copyObj->setLname($this->lname);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach($this->getAsignarEsts() as $relObj) {
				$copyObj->addAsignarEst($relObj->copy($deepCopy));
			}

			foreach($this->getCitasRelatedByEspecialistaId() as $relObj) {
				$copyObj->addCitaRelatedByEspecialistaId($relObj->copy($deepCopy));
			}

			foreach($this->getCitasRelatedBySolicitanteId() as $relObj) {
				$copyObj->addCitaRelatedBySolicitanteId($relObj->copy($deepCopy));
			}

			foreach($this->getConsultas() as $relObj) {
				$copyObj->addConsulta($relObj->copy($deepCopy));
			}

			foreach($this->getDatoEstudiantes() as $relObj) {
				$copyObj->addDatoEstudiante($relObj->copy($deepCopy));
			}

			foreach($this->getDatoPersonals() as $relObj) {
				$copyObj->addDatoPersonal($relObj->copy($deepCopy));
			}

			foreach($this->getDatoTrabajos() as $relObj) {
				$copyObj->addDatoTrabajo($relObj->copy($deepCopy));
			}

			foreach($this->getEstudianteAspirantes() as $relObj) {
				$copyObj->addEstudianteAspirante($relObj->copy($deepCopy));
			}

			foreach($this->getExpedienteEstAsesors() as $relObj) {
				$copyObj->addExpedienteEstAsesor($relObj->copy($deepCopy));
			}

			foreach($this->getHorarios() as $relObj) {
				$copyObj->addHorario($relObj->copy($deepCopy));
			}

			foreach($this->getMensajeriaInternas() as $relObj) {
				$copyObj->addMensajeriaInterna($relObj->copy($deepCopy));
			}

			foreach($this->getNoticias() as $relObj) {
				$copyObj->addNoticia($relObj->copy($deepCopy));
			}

			foreach($this->getSesionAsesorias() as $relObj) {
				$copyObj->addSesionAsesoria($relObj->copy($deepCopy));
			}

			foreach($this->getSolicitudTallers() as $relObj) {
				$copyObj->addSolicitudTaller($relObj->copy($deepCopy));
			}

			foreach($this->getUsuarioDepartamentos() as $relObj) {
				$copyObj->addUsuarioDepartamento($relObj->copy($deepCopy));
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new AteneausuarioPeer();
		}
		return self::$peer;
	}

	
	public function setRol($v)
	{


		if ($v === null) {
			$this->setRolId(NULL);
		} else {
			$this->setRolId($v->getId());
		}


		$this->aRol = $v;
	}


	
	public function getRol($con = null)
	{
				include_once 'lib/model/om/BaseRolPeer.php';

		if ($this->aRol === null && ($this->rol_id !== null)) {

			$this->aRol = RolPeer::retrieveByPK($this->rol_id, $con);

			
		}
		return $this->aRol;
	}

	
	public function initAsignarEsts()
	{
		if ($this->collAsignarEsts === null) {
			$this->collAsignarEsts = array();
		}
	}

	
	public function getAsignarEsts($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseAsignarEstPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAsignarEsts === null) {
			if ($this->isNew()) {
			   $this->collAsignarEsts = array();
			} else {

				$criteria->add(AsignarEstPeer::PROFESOR_ID, $this->getId());

				AsignarEstPeer::addSelectColumns($criteria);
				$this->collAsignarEsts = AsignarEstPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(AsignarEstPeer::PROFESOR_ID, $this->getId());

				AsignarEstPeer::addSelectColumns($criteria);
				if (!isset($this->lastAsignarEstCriteria) || !$this->lastAsignarEstCriteria->equals($criteria)) {
					$this->collAsignarEsts = AsignarEstPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastAsignarEstCriteria = $criteria;
		return $this->collAsignarEsts;
	}

	
	public function countAsignarEsts($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseAsignarEstPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(AsignarEstPeer::PROFESOR_ID, $this->getId());

		return AsignarEstPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addAsignarEst(AsignarEst $l)
	{
		$this->collAsignarEsts[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getAsignarEstsJoinDatoEstudiante($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseAsignarEstPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAsignarEsts === null) {
			if ($this->isNew()) {
				$this->collAsignarEsts = array();
			} else {

				$criteria->add(AsignarEstPeer::PROFESOR_ID, $this->getId());

				$this->collAsignarEsts = AsignarEstPeer::doSelectJoinDatoEstudiante($criteria, $con);
			}
		} else {
									
			$criteria->add(AsignarEstPeer::PROFESOR_ID, $this->getId());

			if (!isset($this->lastAsignarEstCriteria) || !$this->lastAsignarEstCriteria->equals($criteria)) {
				$this->collAsignarEsts = AsignarEstPeer::doSelectJoinDatoEstudiante($criteria, $con);
			}
		}
		$this->lastAsignarEstCriteria = $criteria;

		return $this->collAsignarEsts;
	}

	
	public function initCitasRelatedByEspecialistaId()
	{
		if ($this->collCitasRelatedByEspecialistaId === null) {
			$this->collCitasRelatedByEspecialistaId = array();
		}
	}

	
	public function getCitasRelatedByEspecialistaId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCitasRelatedByEspecialistaId === null) {
			if ($this->isNew()) {
			   $this->collCitasRelatedByEspecialistaId = array();
			} else {

				$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

				CitaPeer::addSelectColumns($criteria);
				$this->collCitasRelatedByEspecialistaId = CitaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

				CitaPeer::addSelectColumns($criteria);
				if (!isset($this->lastCitaRelatedByEspecialistaIdCriteria) || !$this->lastCitaRelatedByEspecialistaIdCriteria->equals($criteria)) {
					$this->collCitasRelatedByEspecialistaId = CitaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCitaRelatedByEspecialistaIdCriteria = $criteria;
		return $this->collCitasRelatedByEspecialistaId;
	}

	
	public function countCitasRelatedByEspecialistaId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

		return CitaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCitaRelatedByEspecialistaId(Cita $l)
	{
		$this->collCitasRelatedByEspecialistaId[] = $l;
		$l->setAteneausuarioRelatedByEspecialistaId($this);
	}


	
	public function getCitasRelatedByEspecialistaIdJoinTurno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCitasRelatedByEspecialistaId === null) {
			if ($this->isNew()) {
				$this->collCitasRelatedByEspecialistaId = array();
			} else {

				$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

				$this->collCitasRelatedByEspecialistaId = CitaPeer::doSelectJoinTurno($criteria, $con);
			}
		} else {
									
			$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

			if (!isset($this->lastCitaRelatedByEspecialistaIdCriteria) || !$this->lastCitaRelatedByEspecialistaIdCriteria->equals($criteria)) {
				$this->collCitasRelatedByEspecialistaId = CitaPeer::doSelectJoinTurno($criteria, $con);
			}
		}
		$this->lastCitaRelatedByEspecialistaIdCriteria = $criteria;

		return $this->collCitasRelatedByEspecialistaId;
	}


	
	public function getCitasRelatedByEspecialistaIdJoinBloque($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCitasRelatedByEspecialistaId === null) {
			if ($this->isNew()) {
				$this->collCitasRelatedByEspecialistaId = array();
			} else {

				$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

				$this->collCitasRelatedByEspecialistaId = CitaPeer::doSelectJoinBloque($criteria, $con);
			}
		} else {
									
			$criteria->add(CitaPeer::ESPECIALISTA_ID, $this->getId());

			if (!isset($this->lastCitaRelatedByEspecialistaIdCriteria) || !$this->lastCitaRelatedByEspecialistaIdCriteria->equals($criteria)) {
				$this->collCitasRelatedByEspecialistaId = CitaPeer::doSelectJoinBloque($criteria, $con);
			}
		}
		$this->lastCitaRelatedByEspecialistaIdCriteria = $criteria;

		return $this->collCitasRelatedByEspecialistaId;
	}

	
	public function initCitasRelatedBySolicitanteId()
	{
		if ($this->collCitasRelatedBySolicitanteId === null) {
			$this->collCitasRelatedBySolicitanteId = array();
		}
	}

	
	public function getCitasRelatedBySolicitanteId($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCitasRelatedBySolicitanteId === null) {
			if ($this->isNew()) {
			   $this->collCitasRelatedBySolicitanteId = array();
			} else {

				$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

				CitaPeer::addSelectColumns($criteria);
				$this->collCitasRelatedBySolicitanteId = CitaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

				CitaPeer::addSelectColumns($criteria);
				if (!isset($this->lastCitaRelatedBySolicitanteIdCriteria) || !$this->lastCitaRelatedBySolicitanteIdCriteria->equals($criteria)) {
					$this->collCitasRelatedBySolicitanteId = CitaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastCitaRelatedBySolicitanteIdCriteria = $criteria;
		return $this->collCitasRelatedBySolicitanteId;
	}

	
	public function countCitasRelatedBySolicitanteId($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

		return CitaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addCitaRelatedBySolicitanteId(Cita $l)
	{
		$this->collCitasRelatedBySolicitanteId[] = $l;
		$l->setAteneausuarioRelatedBySolicitanteId($this);
	}


	
	public function getCitasRelatedBySolicitanteIdJoinTurno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCitasRelatedBySolicitanteId === null) {
			if ($this->isNew()) {
				$this->collCitasRelatedBySolicitanteId = array();
			} else {

				$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

				$this->collCitasRelatedBySolicitanteId = CitaPeer::doSelectJoinTurno($criteria, $con);
			}
		} else {
									
			$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

			if (!isset($this->lastCitaRelatedBySolicitanteIdCriteria) || !$this->lastCitaRelatedBySolicitanteIdCriteria->equals($criteria)) {
				$this->collCitasRelatedBySolicitanteId = CitaPeer::doSelectJoinTurno($criteria, $con);
			}
		}
		$this->lastCitaRelatedBySolicitanteIdCriteria = $criteria;

		return $this->collCitasRelatedBySolicitanteId;
	}


	
	public function getCitasRelatedBySolicitanteIdJoinBloque($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseCitaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collCitasRelatedBySolicitanteId === null) {
			if ($this->isNew()) {
				$this->collCitasRelatedBySolicitanteId = array();
			} else {

				$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

				$this->collCitasRelatedBySolicitanteId = CitaPeer::doSelectJoinBloque($criteria, $con);
			}
		} else {
									
			$criteria->add(CitaPeer::SOLICITANTE_ID, $this->getId());

			if (!isset($this->lastCitaRelatedBySolicitanteIdCriteria) || !$this->lastCitaRelatedBySolicitanteIdCriteria->equals($criteria)) {
				$this->collCitasRelatedBySolicitanteId = CitaPeer::doSelectJoinBloque($criteria, $con);
			}
		}
		$this->lastCitaRelatedBySolicitanteIdCriteria = $criteria;

		return $this->collCitasRelatedBySolicitanteId;
	}

	
	public function initConsultas()
	{
		if ($this->collConsultas === null) {
			$this->collConsultas = array();
		}
	}

	
	public function getConsultas($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
			   $this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				ConsultaPeer::addSelectColumns($criteria);
				$this->collConsultas = ConsultaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				ConsultaPeer::addSelectColumns($criteria);
				if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
					$this->collConsultas = ConsultaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastConsultaCriteria = $criteria;
		return $this->collConsultas;
	}

	
	public function countConsultas($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

		return ConsultaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addConsulta(Consulta $l)
	{
		$this->collConsultas[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getConsultasJoinDiagnostico($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
				$this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				$this->collConsultas = ConsultaPeer::doSelectJoinDiagnostico($criteria, $con);
			}
		} else {
									
			$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

			if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
				$this->collConsultas = ConsultaPeer::doSelectJoinDiagnostico($criteria, $con);
			}
		}
		$this->lastConsultaCriteria = $criteria;

		return $this->collConsultas;
	}


	
	public function getConsultasJoinDatoEstudiante($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
				$this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				$this->collConsultas = ConsultaPeer::doSelectJoinDatoEstudiante($criteria, $con);
			}
		} else {
									
			$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

			if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
				$this->collConsultas = ConsultaPeer::doSelectJoinDatoEstudiante($criteria, $con);
			}
		}
		$this->lastConsultaCriteria = $criteria;

		return $this->collConsultas;
	}


	
	public function getConsultasJoinMotivoConsulta($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
				$this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				$this->collConsultas = ConsultaPeer::doSelectJoinMotivoConsulta($criteria, $con);
			}
		} else {
									
			$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

			if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
				$this->collConsultas = ConsultaPeer::doSelectJoinMotivoConsulta($criteria, $con);
			}
		}
		$this->lastConsultaCriteria = $criteria;

		return $this->collConsultas;
	}


	
	public function getConsultasJoinTrastorno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
				$this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				$this->collConsultas = ConsultaPeer::doSelectJoinTrastorno($criteria, $con);
			}
		} else {
									
			$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

			if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
				$this->collConsultas = ConsultaPeer::doSelectJoinTrastorno($criteria, $con);
			}
		}
		$this->lastConsultaCriteria = $criteria;

		return $this->collConsultas;
	}


	
	public function getConsultasJoinHistoriaPsicologica($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
				$this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				$this->collConsultas = ConsultaPeer::doSelectJoinHistoriaPsicologica($criteria, $con);
			}
		} else {
									
			$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

			if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
				$this->collConsultas = ConsultaPeer::doSelectJoinHistoriaPsicologica($criteria, $con);
			}
		}
		$this->lastConsultaCriteria = $criteria;

		return $this->collConsultas;
	}


	
	public function getConsultasJoinCita($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseConsultaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collConsultas === null) {
			if ($this->isNew()) {
				$this->collConsultas = array();
			} else {

				$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

				$this->collConsultas = ConsultaPeer::doSelectJoinCita($criteria, $con);
			}
		} else {
									
			$criteria->add(ConsultaPeer::ENTREVISTADO_POR_ID, $this->getId());

			if (!isset($this->lastConsultaCriteria) || !$this->lastConsultaCriteria->equals($criteria)) {
				$this->collConsultas = ConsultaPeer::doSelectJoinCita($criteria, $con);
			}
		}
		$this->lastConsultaCriteria = $criteria;

		return $this->collConsultas;
	}

	
	public function initDatoEstudiantes()
	{
		if ($this->collDatoEstudiantes === null) {
			$this->collDatoEstudiantes = array();
		}
	}

	
	public function getDatoEstudiantes($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseDatoEstudiantePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDatoEstudiantes === null) {
			if ($this->isNew()) {
			   $this->collDatoEstudiantes = array();
			} else {

				$criteria->add(DatoEstudiantePeer::USUARIOATENEA_ID, $this->getId());

				DatoEstudiantePeer::addSelectColumns($criteria);
				$this->collDatoEstudiantes = DatoEstudiantePeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(DatoEstudiantePeer::USUARIOATENEA_ID, $this->getId());

				DatoEstudiantePeer::addSelectColumns($criteria);
				if (!isset($this->lastDatoEstudianteCriteria) || !$this->lastDatoEstudianteCriteria->equals($criteria)) {
					$this->collDatoEstudiantes = DatoEstudiantePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastDatoEstudianteCriteria = $criteria;
		return $this->collDatoEstudiantes;
	}

	
	public function countDatoEstudiantes($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseDatoEstudiantePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(DatoEstudiantePeer::USUARIOATENEA_ID, $this->getId());

		return DatoEstudiantePeer::doCount($criteria, $distinct, $con);
	}

	
	public function addDatoEstudiante(DatoEstudiante $l)
	{
		$this->collDatoEstudiantes[] = $l;
		$l->setAteneausuario($this);
	}

	
	public function initDatoPersonals()
	{
		if ($this->collDatoPersonals === null) {
			$this->collDatoPersonals = array();
		}
	}

	
	public function getDatoPersonals($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseDatoPersonalPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDatoPersonals === null) {
			if ($this->isNew()) {
			   $this->collDatoPersonals = array();
			} else {

				$criteria->add(DatoPersonalPeer::USUARIO_ID, $this->getId());

				DatoPersonalPeer::addSelectColumns($criteria);
				$this->collDatoPersonals = DatoPersonalPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(DatoPersonalPeer::USUARIO_ID, $this->getId());

				DatoPersonalPeer::addSelectColumns($criteria);
				if (!isset($this->lastDatoPersonalCriteria) || !$this->lastDatoPersonalCriteria->equals($criteria)) {
					$this->collDatoPersonals = DatoPersonalPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastDatoPersonalCriteria = $criteria;
		return $this->collDatoPersonals;
	}

	
	public function countDatoPersonals($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseDatoPersonalPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(DatoPersonalPeer::USUARIO_ID, $this->getId());

		return DatoPersonalPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addDatoPersonal(DatoPersonal $l)
	{
		$this->collDatoPersonals[] = $l;
		$l->setAteneausuario($this);
	}

	
	public function initDatoTrabajos()
	{
		if ($this->collDatoTrabajos === null) {
			$this->collDatoTrabajos = array();
		}
	}

	
	public function getDatoTrabajos($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseDatoTrabajoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDatoTrabajos === null) {
			if ($this->isNew()) {
			   $this->collDatoTrabajos = array();
			} else {

				$criteria->add(DatoTrabajoPeer::USUARIO_ID, $this->getId());

				DatoTrabajoPeer::addSelectColumns($criteria);
				$this->collDatoTrabajos = DatoTrabajoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(DatoTrabajoPeer::USUARIO_ID, $this->getId());

				DatoTrabajoPeer::addSelectColumns($criteria);
				if (!isset($this->lastDatoTrabajoCriteria) || !$this->lastDatoTrabajoCriteria->equals($criteria)) {
					$this->collDatoTrabajos = DatoTrabajoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastDatoTrabajoCriteria = $criteria;
		return $this->collDatoTrabajos;
	}

	
	public function countDatoTrabajos($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseDatoTrabajoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(DatoTrabajoPeer::USUARIO_ID, $this->getId());

		return DatoTrabajoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addDatoTrabajo(DatoTrabajo $l)
	{
		$this->collDatoTrabajos[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getDatoTrabajosJoinDepartamento($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseDatoTrabajoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collDatoTrabajos === null) {
			if ($this->isNew()) {
				$this->collDatoTrabajos = array();
			} else {

				$criteria->add(DatoTrabajoPeer::USUARIO_ID, $this->getId());

				$this->collDatoTrabajos = DatoTrabajoPeer::doSelectJoinDepartamento($criteria, $con);
			}
		} else {
									
			$criteria->add(DatoTrabajoPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastDatoTrabajoCriteria) || !$this->lastDatoTrabajoCriteria->equals($criteria)) {
				$this->collDatoTrabajos = DatoTrabajoPeer::doSelectJoinDepartamento($criteria, $con);
			}
		}
		$this->lastDatoTrabajoCriteria = $criteria;

		return $this->collDatoTrabajos;
	}

	
	public function initEstudianteAspirantes()
	{
		if ($this->collEstudianteAspirantes === null) {
			$this->collEstudianteAspirantes = array();
		}
	}

	
	public function getEstudianteAspirantes($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseEstudianteAspirantePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEstudianteAspirantes === null) {
			if ($this->isNew()) {
			   $this->collEstudianteAspirantes = array();
			} else {

				$criteria->add(EstudianteAspirantePeer::USUARIO_ID, $this->getId());

				EstudianteAspirantePeer::addSelectColumns($criteria);
				$this->collEstudianteAspirantes = EstudianteAspirantePeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EstudianteAspirantePeer::USUARIO_ID, $this->getId());

				EstudianteAspirantePeer::addSelectColumns($criteria);
				if (!isset($this->lastEstudianteAspiranteCriteria) || !$this->lastEstudianteAspiranteCriteria->equals($criteria)) {
					$this->collEstudianteAspirantes = EstudianteAspirantePeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEstudianteAspiranteCriteria = $criteria;
		return $this->collEstudianteAspirantes;
	}

	
	public function countEstudianteAspirantes($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseEstudianteAspirantePeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EstudianteAspirantePeer::USUARIO_ID, $this->getId());

		return EstudianteAspirantePeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEstudianteAspirante(EstudianteAspirante $l)
	{
		$this->collEstudianteAspirantes[] = $l;
		$l->setAteneausuario($this);
	}

	
	public function initExpedienteEstAsesors()
	{
		if ($this->collExpedienteEstAsesors === null) {
			$this->collExpedienteEstAsesors = array();
		}
	}

	
	public function getExpedienteEstAsesors($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseExpedienteEstAsesorPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collExpedienteEstAsesors === null) {
			if ($this->isNew()) {
			   $this->collExpedienteEstAsesors = array();
			} else {

				$criteria->add(ExpedienteEstAsesorPeer::USUARIO_ID, $this->getId());

				ExpedienteEstAsesorPeer::addSelectColumns($criteria);
				$this->collExpedienteEstAsesors = ExpedienteEstAsesorPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(ExpedienteEstAsesorPeer::USUARIO_ID, $this->getId());

				ExpedienteEstAsesorPeer::addSelectColumns($criteria);
				if (!isset($this->lastExpedienteEstAsesorCriteria) || !$this->lastExpedienteEstAsesorCriteria->equals($criteria)) {
					$this->collExpedienteEstAsesors = ExpedienteEstAsesorPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastExpedienteEstAsesorCriteria = $criteria;
		return $this->collExpedienteEstAsesors;
	}

	
	public function countExpedienteEstAsesors($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseExpedienteEstAsesorPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(ExpedienteEstAsesorPeer::USUARIO_ID, $this->getId());

		return ExpedienteEstAsesorPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addExpedienteEstAsesor(ExpedienteEstAsesor $l)
	{
		$this->collExpedienteEstAsesors[] = $l;
		$l->setAteneausuario($this);
	}

	
	public function initHorarios()
	{
		if ($this->collHorarios === null) {
			$this->collHorarios = array();
		}
	}

	
	public function getHorarios($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarios === null) {
			if ($this->isNew()) {
			   $this->collHorarios = array();
			} else {

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				$this->collHorarios = HorarioPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				HorarioPeer::addSelectColumns($criteria);
				if (!isset($this->lastHorarioCriteria) || !$this->lastHorarioCriteria->equals($criteria)) {
					$this->collHorarios = HorarioPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHorarioCriteria = $criteria;
		return $this->collHorarios;
	}

	
	public function countHorarios($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

		return HorarioPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHorario(Horario $l)
	{
		$this->collHorarios[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getHorariosJoinEvento($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarios === null) {
			if ($this->isNew()) {
				$this->collHorarios = array();
			} else {

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				$this->collHorarios = HorarioPeer::doSelectJoinEvento($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastHorarioCriteria) || !$this->lastHorarioCriteria->equals($criteria)) {
				$this->collHorarios = HorarioPeer::doSelectJoinEvento($criteria, $con);
			}
		}
		$this->lastHorarioCriteria = $criteria;

		return $this->collHorarios;
	}


	
	public function getHorariosJoinTurno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseHorarioPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHorarios === null) {
			if ($this->isNew()) {
				$this->collHorarios = array();
			} else {

				$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

				$this->collHorarios = HorarioPeer::doSelectJoinTurno($criteria, $con);
			}
		} else {
									
			$criteria->add(HorarioPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastHorarioCriteria) || !$this->lastHorarioCriteria->equals($criteria)) {
				$this->collHorarios = HorarioPeer::doSelectJoinTurno($criteria, $con);
			}
		}
		$this->lastHorarioCriteria = $criteria;

		return $this->collHorarios;
	}

	
	public function initMensajeriaInternas()
	{
		if ($this->collMensajeriaInternas === null) {
			$this->collMensajeriaInternas = array();
		}
	}

	
	public function getMensajeriaInternas($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseMensajeriaInternaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collMensajeriaInternas === null) {
			if ($this->isNew()) {
			   $this->collMensajeriaInternas = array();
			} else {

				$criteria->add(MensajeriaInternaPeer::DESTINATARIO_ID, $this->getId());

				MensajeriaInternaPeer::addSelectColumns($criteria);
				$this->collMensajeriaInternas = MensajeriaInternaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(MensajeriaInternaPeer::DESTINATARIO_ID, $this->getId());

				MensajeriaInternaPeer::addSelectColumns($criteria);
				if (!isset($this->lastMensajeriaInternaCriteria) || !$this->lastMensajeriaInternaCriteria->equals($criteria)) {
					$this->collMensajeriaInternas = MensajeriaInternaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastMensajeriaInternaCriteria = $criteria;
		return $this->collMensajeriaInternas;
	}

	
	public function countMensajeriaInternas($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseMensajeriaInternaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(MensajeriaInternaPeer::DESTINATARIO_ID, $this->getId());

		return MensajeriaInternaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addMensajeriaInterna(MensajeriaInterna $l)
	{
		$this->collMensajeriaInternas[] = $l;
		$l->setAteneausuario($this);
	}

	
	public function initNoticias()
	{
		if ($this->collNoticias === null) {
			$this->collNoticias = array();
		}
	}

	
	public function getNoticias($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseNoticiaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collNoticias === null) {
			if ($this->isNew()) {
			   $this->collNoticias = array();
			} else {

				$criteria->add(NoticiaPeer::USUARIO_ID, $this->getId());

				NoticiaPeer::addSelectColumns($criteria);
				$this->collNoticias = NoticiaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(NoticiaPeer::USUARIO_ID, $this->getId());

				NoticiaPeer::addSelectColumns($criteria);
				if (!isset($this->lastNoticiaCriteria) || !$this->lastNoticiaCriteria->equals($criteria)) {
					$this->collNoticias = NoticiaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastNoticiaCriteria = $criteria;
		return $this->collNoticias;
	}

	
	public function countNoticias($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseNoticiaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(NoticiaPeer::USUARIO_ID, $this->getId());

		return NoticiaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addNoticia(Noticia $l)
	{
		$this->collNoticias[] = $l;
		$l->setAteneausuario($this);
	}

	
	public function initSesionAsesorias()
	{
		if ($this->collSesionAsesorias === null) {
			$this->collSesionAsesorias = array();
		}
	}

	
	public function getSesionAsesorias($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSesionAsesoriaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSesionAsesorias === null) {
			if ($this->isNew()) {
			   $this->collSesionAsesorias = array();
			} else {

				$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

				SesionAsesoriaPeer::addSelectColumns($criteria);
				$this->collSesionAsesorias = SesionAsesoriaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

				SesionAsesoriaPeer::addSelectColumns($criteria);
				if (!isset($this->lastSesionAsesoriaCriteria) || !$this->lastSesionAsesoriaCriteria->equals($criteria)) {
					$this->collSesionAsesorias = SesionAsesoriaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastSesionAsesoriaCriteria = $criteria;
		return $this->collSesionAsesorias;
	}

	
	public function countSesionAsesorias($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseSesionAsesoriaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

		return SesionAsesoriaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addSesionAsesoria(SesionAsesoria $l)
	{
		$this->collSesionAsesorias[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getSesionAsesoriasJoinDatoEstudiante($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSesionAsesoriaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSesionAsesorias === null) {
			if ($this->isNew()) {
				$this->collSesionAsesorias = array();
			} else {

				$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

				$this->collSesionAsesorias = SesionAsesoriaPeer::doSelectJoinDatoEstudiante($criteria, $con);
			}
		} else {
									
			$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

			if (!isset($this->lastSesionAsesoriaCriteria) || !$this->lastSesionAsesoriaCriteria->equals($criteria)) {
				$this->collSesionAsesorias = SesionAsesoriaPeer::doSelectJoinDatoEstudiante($criteria, $con);
			}
		}
		$this->lastSesionAsesoriaCriteria = $criteria;

		return $this->collSesionAsesorias;
	}


	
	public function getSesionAsesoriasJoinTurno($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSesionAsesoriaPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSesionAsesorias === null) {
			if ($this->isNew()) {
				$this->collSesionAsesorias = array();
			} else {

				$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

				$this->collSesionAsesorias = SesionAsesoriaPeer::doSelectJoinTurno($criteria, $con);
			}
		} else {
									
			$criteria->add(SesionAsesoriaPeer::ASESOR_ID, $this->getId());

			if (!isset($this->lastSesionAsesoriaCriteria) || !$this->lastSesionAsesoriaCriteria->equals($criteria)) {
				$this->collSesionAsesorias = SesionAsesoriaPeer::doSelectJoinTurno($criteria, $con);
			}
		}
		$this->lastSesionAsesoriaCriteria = $criteria;

		return $this->collSesionAsesorias;
	}

	
	public function initSolicitudTallers()
	{
		if ($this->collSolicitudTallers === null) {
			$this->collSolicitudTallers = array();
		}
	}

	
	public function getSolicitudTallers($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSolicitudTallerPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSolicitudTallers === null) {
			if ($this->isNew()) {
			   $this->collSolicitudTallers = array();
			} else {

				$criteria->add(SolicitudTallerPeer::USUARIO_ID, $this->getId());

				SolicitudTallerPeer::addSelectColumns($criteria);
				$this->collSolicitudTallers = SolicitudTallerPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(SolicitudTallerPeer::USUARIO_ID, $this->getId());

				SolicitudTallerPeer::addSelectColumns($criteria);
				if (!isset($this->lastSolicitudTallerCriteria) || !$this->lastSolicitudTallerCriteria->equals($criteria)) {
					$this->collSolicitudTallers = SolicitudTallerPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastSolicitudTallerCriteria = $criteria;
		return $this->collSolicitudTallers;
	}

	
	public function countSolicitudTallers($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseSolicitudTallerPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(SolicitudTallerPeer::USUARIO_ID, $this->getId());

		return SolicitudTallerPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addSolicitudTaller(SolicitudTaller $l)
	{
		$this->collSolicitudTallers[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getSolicitudTallersJoinTaller($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseSolicitudTallerPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSolicitudTallers === null) {
			if ($this->isNew()) {
				$this->collSolicitudTallers = array();
			} else {

				$criteria->add(SolicitudTallerPeer::USUARIO_ID, $this->getId());

				$this->collSolicitudTallers = SolicitudTallerPeer::doSelectJoinTaller($criteria, $con);
			}
		} else {
									
			$criteria->add(SolicitudTallerPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastSolicitudTallerCriteria) || !$this->lastSolicitudTallerCriteria->equals($criteria)) {
				$this->collSolicitudTallers = SolicitudTallerPeer::doSelectJoinTaller($criteria, $con);
			}
		}
		$this->lastSolicitudTallerCriteria = $criteria;

		return $this->collSolicitudTallers;
	}

	
	public function initUsuarioDepartamentos()
	{
		if ($this->collUsuarioDepartamentos === null) {
			$this->collUsuarioDepartamentos = array();
		}
	}

	
	public function getUsuarioDepartamentos($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioDepartamentoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioDepartamentos === null) {
			if ($this->isNew()) {
			   $this->collUsuarioDepartamentos = array();
			} else {

				$criteria->add(UsuarioDepartamentoPeer::USUARIO_ID, $this->getId());

				UsuarioDepartamentoPeer::addSelectColumns($criteria);
				$this->collUsuarioDepartamentos = UsuarioDepartamentoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(UsuarioDepartamentoPeer::USUARIO_ID, $this->getId());

				UsuarioDepartamentoPeer::addSelectColumns($criteria);
				if (!isset($this->lastUsuarioDepartamentoCriteria) || !$this->lastUsuarioDepartamentoCriteria->equals($criteria)) {
					$this->collUsuarioDepartamentos = UsuarioDepartamentoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUsuarioDepartamentoCriteria = $criteria;
		return $this->collUsuarioDepartamentos;
	}

	
	public function countUsuarioDepartamentos($criteria = null, $distinct = false, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioDepartamentoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(UsuarioDepartamentoPeer::USUARIO_ID, $this->getId());

		return UsuarioDepartamentoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUsuarioDepartamento(UsuarioDepartamento $l)
	{
		$this->collUsuarioDepartamentos[] = $l;
		$l->setAteneausuario($this);
	}


	
	public function getUsuarioDepartamentosJoinDepartamentoOrientacion($criteria = null, $con = null)
	{
				include_once 'lib/model/om/BaseUsuarioDepartamentoPeer.php';
		if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUsuarioDepartamentos === null) {
			if ($this->isNew()) {
				$this->collUsuarioDepartamentos = array();
			} else {

				$criteria->add(UsuarioDepartamentoPeer::USUARIO_ID, $this->getId());

				$this->collUsuarioDepartamentos = UsuarioDepartamentoPeer::doSelectJoinDepartamentoOrientacion($criteria, $con);
			}
		} else {
									
			$criteria->add(UsuarioDepartamentoPeer::USUARIO_ID, $this->getId());

			if (!isset($this->lastUsuarioDepartamentoCriteria) || !$this->lastUsuarioDepartamentoCriteria->equals($criteria)) {
				$this->collUsuarioDepartamentos = UsuarioDepartamentoPeer::doSelectJoinDepartamentoOrientacion($criteria, $con);
			}
		}
		$this->lastUsuarioDepartamentoCriteria = $criteria;

		return $this->collUsuarioDepartamentos;
	}

} 